/**
 * 
 */
package valverde.nacho.stripes;

import net.sourceforge.stripes.action.ActionBean;
import net.sourceforge.stripes.action.ActionBeanContext;
import valverde.nacho.dao.ContactDao;
import valverde.nacho.dao.impl.MockContactDao;
import valverde.nacho.domain.Contact;

/**
 * @author ignacio.canon@entelgy.com
 */
public class MyActionBeanBase implements ActionBean {
    public static final String LIST = "/WEB-INF/jsp/contactList.jsp";
    public static final String VIEW = "/WEB-INF/jsp/contactView.jsp";
    public static final String FORM = "/WEB-INF/jsp/contactForm.jsp";
    /** ctx */
    private ActionBeanContext ctx;
    private Integer contactId;
    private ContactDao contactDao = MockContactDao.getInstance();
    private Contact contact;

    /*
     * (non-Javadoc)
     * 
     * @see net.sourceforge.stripes.action.ActionBean#getContext()
     */
    public ActionBeanContext getContext() {
	return ctx;
    }

    /*
     * (non-Javadoc)
     * 
     * @see
     * net.sourceforge.stripes.action.ActionBean#setContext(net.sourceforge.
     * stripes.action.ActionBeanContext)
     */
    public void setContext(ActionBeanContext arg0) {
	this.ctx = arg0;
    }

    /**
     * getter para el campo contactId
     * 
     * @return contactId
     */
    public final Integer getContactId() {
	return contactId;
    }

    /**
     * @param contactId
     *            establece el valor de contactId
     */
    public final void setContactId(Integer contactId) {
	this.contactId = contactId;
    }

    /**
     * getter para el campo contact
     * 
     * @return contact
     */
    public final Contact getContact() {
	contact = contactDao.read(contactId);
	return contact;
    }

    /**
     * getter para el campo contactDao
     * 
     * @return contactDao
     */
    public final ContactDao getContactDao() {
	return contactDao;
    }

    /**
     * @param contactDao
     *            establece el valor de contactDao
     */
    public final void setContactDao(ContactDao contactDao) {
	this.contactDao = contactDao;
    }

    /**
     * @param contact
     *            establece el valor de contact
     */
    public final void setContact(Contact contact) {
	this.contact = contact;
    }

}
